import requests
from application import settings

def get_wechat_info(code):
    url = f"https://api.weixin.qq.com/sns/jscode2session?appid={settings.WECHAT['app_id']}&secret={settings.WECHAT['app_secret']}&js_code={code}&grant_type=authorization_code"
    response = requests.get(url)
    return response.json()